<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="${pageContext.request.contextPath}/adminfile/js/html5.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/adminfile/js/respond.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/adminfile/js/PIE_IE678.js"></script>
<![endif]-->
<link href="${pageContext.request.contextPath}/adminfile/assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/css/style.css"/>       
<link href="${pageContext.request.contextPath}/adminfile/assets/css/codemirror.css" rel="stylesheet">
<link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/assets/css/ace.min.css" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/Widget/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/adminfile/assets/css/font-awesome.min.css" />
<!--[if IE 7]>
		  <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/font-awesome-ie7.min.css" />
		<![endif]-->
<link href="${pageContext.request.contextPath}/adminfile/Widget/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/adminfile/Widget/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/`css" />
<title>入库</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/adminfile/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function name() {
  $("#artCost").blur(function(){
	  var val=$(this).val();
	  var s=$("#artSum").val();
	  if(!val.match(/^(\+)?\d+(\.\d+)?$/))
		  {
		  alert("价格必须为正数，请重新输入！")
		  return false;
		  }
	  else
	  {
		  if(s.match(/^[1-9]\d*$/))
	          $("#amount").val(Number(s)*Number(val));
		 
	  }
	  
	    
})
  $("#artSum").blur(function(){
	  var s=$("#artCost").val();
	  var val=$(this).val();
	 if(!val.match(/^[1-9]\d*$/)){
		 alert("数量必须为正整数，请重新输入！")
		 return false;
	 }		  
	  else
	  {
		  if(val.match(/^(\+)?\d+(\.\d+)?$/))
			  $("#amount").val(Number(s)*Number(val));
		 
	  }
})

})

</script>
</head>
<body>
   <div class="page_right_style">
   <div class="type_title">入库</div>
	<form action="addstock" method="post" class="form form-horizontal" id="form-article-add">
		<div class="clearfix cl">
		<div class="Add_p_s">
         <label class="form-label col-2">艺术品名称：</label>
	     <div class="formControls col-2"><input type="text" class="input-text" value="" placeholder="" id="" name="artName"></div>
		</div>
		</div>
	 <div class=" clearfix cl">
			<!-- <div class="Add_p_s">
            <label class="form-label col-2">类别Id：</label>
			<div class="formControls col-2"><input type="text" class="input-text" value="" placeholder="" id="" name="categoryId"></div>
            </div>-->
			<div class="Add_p_s">
             <label class="form-label col-2">类别：</label>	
			  <div class="formControls col-2"><span class="select-box">
				<select name="categoryName" id="categoryName" class="x-form-set">
                <option value="categoryName">选择类别</option>
                <c:forEach items="${categorylist}" var="c">
               <option value="${c.categoryName}"> ${c.categoryName}</option>
               </c:forEach>
                </select>
				</span></div>
			</div>
            <div class="Add_p_s">
             <label class="form-label col-2">数量：</label>	
			 <div class="formControls col-2"><input type="text" class="input-text" value=""  id="artSum" name="artSum"></div>
			</div>
            <div class="Add_p_s">
             <label class="form-label col-2">单价：</label>	
			 <div class="formControls col-2"><input type="text" class="input-text" value=""  id="artCost" name="artCost"></div>
			</div>
             <div class="Add_p_s">
             <label class="form-label col-2">总金额：</label>	
			 <div class="formControls col-2"><input type="text" class="input-text" value=""  id="amount" name="amount" ></div>
			</div>
             <div class="Add_p_s">
             <label class="form-label col-2">供应商：</label>	
			 <div class="formControls col-2"><span class="select-box">
				<select name="supplierName" id="supplierName" class="x-form-set">
                <option value="supplierName">选择供应商</option>
                <c:forEach items="${list3}" var="p3">
               <option value="${p3.supplierName}"> ${p3.supplierName}</option>
               </c:forEach>
                </select>
				</span></div>
			</div>
           <!--  <div class="Add_p_s">
             <label class="form-label col-2">入库时间：</label>	
			 <div class="formControls col-2"><input type="text" class="input-text" value="" placeholder="" id="" name="artAdddate" ></div>
			</div> -->
            <div class="Add_p_s">
             <label class="form-label col-2">尺寸：</label>	
			 <div class="formControls col-2"><input type="text" class="input-text" value="" placeholder="" id="" name="artSize" ></div>
			</div>			
		</div>
		<!-- 
		<div class="clearfix cl">
			<label class="form-label col-2">关键词：</label>
			<div class="formControls col-2">
				<input type="text" class="input-text" value="" placeholder="" id="" name="">
			</div>
		</div>--> 
		<div class="clearfix cl">
			<label class="form-label col-2">简介：</label>
			<div class="formControls col-5">
				<textarea name="artIntroduce" cols="" rows="" class="textarea"  placeholder="" ></textarea>
			</div>
		</div>
		<!-- <div class="clearfix cl">
			<label class="form-label col-2">图片上传：</label>
			<div class="formControls col-10">
				<div class="uploader-list-container"> 
					<div class="queueList">
						<div id="dndArea" class="placeholder">
							<div id="filePicker-2"></div>
							<p>或将照片拖到这里，单次最多可选300张</p>
						</div>
					</div>
					<div class="statusBar" style="display:none;">
						<div class="progress"> <span class="text">0%</span> <span class="percentage"></span> </div>
						<div class="info"></div>
						<div class="btns">
							<div id="filePicker2"></div>
							<div class="uploadBtn">开始上传</div>
						</div>
					</div>
				</div>
			</div>
		</div> -->
     <!--    <div class="clearfix cl">
         <label class="form-label col-2">允许评论：</label>
			<div class="formControls col-2 skin-minimal">
			 <div class="check-box" style=" margin-top:9px"><input type="checkbox" id="checkbox-1"><label for="checkbox-1">&nbsp;</label></div>
             </div>
        </div>-->
		<div class="clearfix cl">
			<div class="Button_operation">
				<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="icon-save "></i>保存</button>
				<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
    </div>
</body>
</html>